package com.xiaoshuidi.cloud.module.contract.convert.contract;

import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.ContractApplyPageResp;
import com.xiaoshuidi.cloud.module.contract.controller.app.contract.vo.ApplyResp;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.ContractApplyDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 交房退房 Convert
 *
 * @author 合房租赁
 */
@Mapper
public interface ContractApplyConvert {

    ContractApplyConvert INSTANCE = Mappers.getMapper(ContractApplyConvert.class);

    @Mapping(source = "sourceStartTime", target = "sourceStartTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "sourceEndTime", target = "sourceEndTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "startTime", target = "startTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "endTime", target = "endTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "applyTime", target = "applyTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(source = "auditTime", target = "auditTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    ContractApplyPageResp convert(ContractApplyDO bean);

    @Mapping(source = "sourceStartTime", target = "sourceStartTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "sourceEndTime", target = "sourceEndTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "startTime", target = "startTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "endTime", target = "endTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "applyTime", target = "applyTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(source = "auditTime", target = "auditTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    ApplyResp convert2ApplyResp(ContractApplyDO bean);
}
